﻿using System;
using System.Collections.Generic;
using System.ServiceModel;

using Sharp.DataTransferObject.CMS;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.Search;

namespace Sharp.ServiceContracts.CMS
{
    [ServiceContract]
    public interface ICMSService : IApplicationServiceContract
    {
        #region VIU
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveVIU(VIUDTO dtomodel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<VIUDTO> GetVIU(Guid id);

        /// <summary>
        ///     获取VIU分页数据
        /// </summary> 
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<VIUDTO> GetVIUPaged(PagingFeature pf);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteVIUs(Guid ids);
        #endregion


        #region Category

        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteCategories(Guid[] ids);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveCategory(VIUCategoryDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<VIUCategoryDTO> GetCategoryInfo(Guid id);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<IEnumerable<VIUCategoryDTO>> GetCategoryList(bool treeData= true);
        /// <summary>
        /// 获取分类分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<VIUCategoryDTO> GetCategoryPaged(PagingFeature pf);

        #endregion

        #region Field
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteFields(Guid[] ids);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveField(FieldDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<FieldDTO> GetFieldInfo(Guid id);

        [OperationContract, FaultContract(typeof(FaultData))]
        Result<IEnumerable<FieldDTO>> GetFieldList(bool treeData = true);

        #endregion

        #region Tag
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteTags(Guid[] ids);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveTag(TagDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<TagDTO> GetTagInfo(Guid id);

        /// <summary>
        ///     获取分页信息
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<TagDTO> GetTagPaged(PagingFeature pf);

        /// <summary>
        /// 批量导入标签
        /// </summary>
        /// <param name="dtoModel"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveBatchImportTag(TagBatchImportDTO dtoModel);
        #endregion

        #region 审核

        /// <summary>
        /// 审核VIU
        /// </summary>
        /// <param name="viuId"></param>
        /// <param name="isChecked"></param>
        /// <param name="remark"></param>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result CheckInVIU(Guid viuId, bool isChecked, string remark);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result CheckInSpecial(ApproveHistory4SpecialDTO vm);
        #endregion

        #region Article
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveArticle(ArticleDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<ArticleDTO> GetArticleInfo(Guid id);
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<ArticleDTO> GetArticlePaged(PagingFeature pf);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteArticles(Guid[] ids);

        #endregion

        #region Special
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteSpecials(Guid[] ids);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveSpecial(SpecialDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<SpecialDTO> GetSpecialInfo(Guid id);

        /// <summary>
        ///     获取分页信息
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<SpecialDTO> GetSpecialPaged(PagingFeature pf);
        #endregion

        #region Column
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteColumns(Guid[] ids);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveColumn(ColumnDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<ColumnDTO> GetColumnInfo(Guid id);

        /// <summary>
        /// 获取分页信息
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<ColumnDTO> GetColumnPaged(PagingFeature pf);
        /// <summary>
        /// 获取栏目
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<IList<ColumnDTO>> GetColumns();
        #endregion

        #region Gather
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveGather(GatherDTO dtoModel);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<GatherDTO> GetGatherInfo(Guid id);
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<GatherDTO> GetGatherPaged(PagingFeature pf);
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteGathers(Guid[] ids);
        /// <summary>
        /// 采集栏目页面
        /// </summary>
        /// <param name="cp"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        ClassGatherResultDTO GatherCategoryPage(CategoryParameterDTO cp);

        /// <summary>
        ///     采集内容页
        /// </summary>
        /// <param name="wp"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        ContentPageGatherResultDTO GatherPage(WebParameterDTO wp);
        /// <summary>
        /// 获取采集规则
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result<IList<GatherDTO>> GetGathers();

        /// <summary>
        /// 拆解网页
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        ContentPageGatherResultDTO DecomposePage(string strUrl, Guid gatherId, string webhtml);

        #endregion
    }
}